home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / dtd.lang < prev    next >
Extensible Markup Language  |  2009-10-02  |  5KB  |  140 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Yevgen Muntyan <muntyan@tamu.edu>
  5.  Copyright (C) 2006-2007 Yevgen Muntyan <muntyan@tamu.edu>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="dtd" _name="DTD" version="2.0" _section="Markup">
  24.     <metadata>
  25.       <property name="mimetypes">text/x-dtd</property>
  26.       <property name="globs">*.dtd</property>
  27.       <property name="block-comment-start"><!--</property>
  28.       <property name="block-comment-end">--></property>
  29.     </metadata>
  30.  
  31.     <styles>
  32.       <style id="entity" _name="entity" map-to="xml:entity"/>
  33.       <style id="decl" _name="decl" map-to="xml:doctype"/>
  34.       <style id="error" _name="error" map-to="xml:error"/>
  35.       <style id="quoted-value" _name="quoted-value" map-to="xml:attribute-value"/>
  36.     </styles>
  37.  
  38.     <definitions>
  39.       <define-regex id="prefix">[a-zA-Z_][a-zA-Z0-9._-]*</define-regex>
  40.       <define-regex id="name">[a-zA-Z_][a-zA-Z0-9.:_-]*</define-regex>
  41.  
  42.       <context id="entity" style-ref="entity">
  43.         <match>%\%{name};</match>
  44.       </context>
  45.  
  46.       <context id="decl-element">
  47.         <start><!ELEMENT\b</start>
  48.         <end>></end>
  49.         <include>
  50.           <context sub-pattern="0" where="start" style-ref="decl"/>
  51.           <context sub-pattern="0" where="end" style-ref="decl"/>
  52.           <context ref="entity"/>
  53.           <context ref="quoted-value"/>
  54.         </include>
  55.       </context>
  56.  
  57.  
  58.       <context id="quoted-value" style-ref="quoted-value">
  59.         <start>"</start>
  60.         <end>"</end>
  61.         <include>
  62.           <context style-ref="entity">
  63.             <match>[%&]\%{name};</match>
  64.           </context>
  65.           <context style-ref="error" extend-parent="false">
  66.             <match>[%&]\S*</match>
  67.           </context>
  68.         </include>
  69.       </context>
  70.  
  71.       <context id="NDATA" extend-parent="false">
  72.         <start>\bNDATA\b</start>
  73.         <include>
  74.           <context sub-pattern="0" where="start" style-ref="decl"/>
  75.           <context>
  76.             <match>\%{name}</match>
  77.           </context>
  78.           <context ref="error"/>
  79.         </include>
  80.       </context>
  81.  
  82.       <context id="decl-entity">
  83.         <start><!ENTITY\s+(%\s+)?\%{name}\b</start>
  84.         <end>></end>
  85.         <include>
  86.           <context sub-pattern="0" where="start" style-ref="decl"/>
  87.           <context sub-pattern="0" where="end" style-ref="decl"/>
  88.           <context ref="quoted-value"/>
  89.           <context extend-parent="false">
  90.             <start>(SYSTEM|PUBLIC)(?=\s|$)</start>
  91.             <include>
  92.               <context sub-pattern="0" where="start" style-ref="decl"/>
  93.               <context ref="quoted-value"/>
  94.               <context ref="NDATA"/>
  95.               <context ref="error"/>
  96.             </include>
  97.           </context>
  98.           <context ref="error"/>
  99.         </include>
  100.       </context>
  101.  
  102.  
  103.       <context id="decl-attlist">
  104.         <start><!ATTLIST\b</start>
  105.         <end>></end>
  106.         <include>
  107.           <context sub-pattern="0" where="start" style-ref="decl"/>
  108.           <context sub-pattern="0" where="end" style-ref="decl"/>
  109.           <context ref="entity"/>
  110.           <context ref="quoted-value"/>
  111.         </include>
  112.       </context>
  113.  
  114.       <context id="decl-notation">
  115.         <start><!NOTATION\b</start>
  116.         <end>></end>
  117.         <include>
  118.           <context sub-pattern="0" where="start" style-ref="decl"/>
  119.           <context sub-pattern="0" where="end" style-ref="decl"/>
  120.           <context ref="entity"/>
  121.           <context ref="quoted-value"/>
  122.         </include>
  123.       </context>
  124.  
  125.       <context id="error" style-ref="error" extend-parent="false">
  126.         <match>\S+</match>
  127.       </context>
  128.  
  129.       <context id="dtd">
  130.         <include>
  131.           <context ref="xml:comment"/>
  132.           <context ref="decl-element"/>
  133.           <context ref="decl-entity"/>
  134.           <context ref="decl-attlist"/>
  135.           <context ref="decl-notation"/>
  136.         </include>
  137.       </context>
  138.     </definitions>
  139. </language>
  140.